<template>
  <view>
    <button class="button" hover-class="hover" @tap="blueTooth"> 蓝牙设备 </button>
    <button class="button" hover-class="hover" @tap="label"> 打印</button>
  </view>
</template>

<script>
var app = getApp();
export default {
  data() {
    return {
      list: [],
      // printer: {}
    };
  },

  components: {},
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // console.log(options, 'options')
    // this.printer = options.printer
    app.globalData.BLEInformation.platform = app.globalData.getPlatform();
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    uni.closeBLEConnection({
      deviceId: app.globalData.BLEInformation.deviceId,
      success: function (res) {
        console.log("关闭蓝牙成功");
      }
    });
  },

  methods: {
    blueTooth: function () {
      uni.navigateTo({
        url: '../bleConnect/bleConnect'
      });
    },
    //标签案例
    label: function () {
      uni.navigateTo({
        url: '../label/label'
      });
    },

  }
};
</script>
<style>
.button {
  margin-top: 20px;
  width: 90%;
  background-color: #54bec2;
  color: white;
  border-radius: 98rpx;
  background: bg_red;
}

/* 按下变颜色 */
.hover {
  background: #dcdcdc;
}
</style>